mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-25 02:31:59 -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)) {
|
} else if (isNumeric(val)) {
|
||||||
return +val;
|
return +val;
|
||||||
} else if (val.indexOf('{') === 0) {
|
} else if (val.indexOf('{') === 0) {
|
||||||
return JSON.parse(val);
|
try {
|
||||||
|
return JSON.parse(val);
|
||||||
|
} catch (e) {
|
||||||
|
/*jshint unused:false */
|
||||||
|
return val;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue