Skip to content

Commit faf26b4

Browse files
committed
validate inner period param
1 parent f0052ba commit faf26b4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

api/lib/countly.common.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,12 @@ countlyCommon.isValidPeriodParam = function(period) {
786786
}
787787

788788
if (typeof period === 'object') {
789-
return Object.prototype.hasOwnProperty.call(period, 'since') || Object.prototype.hasOwnProperty.call(period, 'period');
789+
if (Object.prototype.hasOwnProperty.call(period, 'period')) {
790+
return countlyCommon.isValidPeriodParam(period.period);
791+
}
792+
else {
793+
return Object.prototype.hasOwnProperty.call(period, 'since')
794+
}
790795
}
791796

792797
return period === 'month' ||

0 commit comments

Comments
 (0)