@forcecalendar/core 2.1.24 → 2.1.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/core/events/Event.js
CHANGED
|
@@ -47,8 +47,12 @@ export class Event {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
// Normalize string fields with size limits
|
|
50
|
-
normalized.id = String(normalized.id || '')
|
|
51
|
-
|
|
50
|
+
normalized.id = String(normalized.id || '')
|
|
51
|
+
.trim()
|
|
52
|
+
.slice(0, Event.FIELD_LIMITS.id);
|
|
53
|
+
normalized.title = String(normalized.title || '')
|
|
54
|
+
.trim()
|
|
55
|
+
.slice(0, Event.FIELD_LIMITS.title);
|
|
52
56
|
normalized.description = String(normalized.description || '')
|
|
53
57
|
.trim()
|
|
54
58
|
.slice(0, Event.FIELD_LIMITS.description);
|
|
@@ -241,8 +241,14 @@ export class EventStore {
|
|
|
241
241
|
for (let offset = -1; offset <= 1; offset++) {
|
|
242
242
|
let m = filters.month + offset;
|
|
243
243
|
let y = filters.year;
|
|
244
|
-
if (m < 1) {
|
|
245
|
-
|
|
244
|
+
if (m < 1) {
|
|
245
|
+
m = 12;
|
|
246
|
+
y--;
|
|
247
|
+
}
|
|
248
|
+
if (m > 12) {
|
|
249
|
+
m = 1;
|
|
250
|
+
y++;
|
|
251
|
+
}
|
|
246
252
|
const key = `${y}-${String(m).padStart(2, '0')}`;
|
|
247
253
|
const ids = this.indices.byMonth.get(key);
|
|
248
254
|
if (ids) {
|
|
@@ -64,9 +64,7 @@ export class RRuleParser {
|
|
|
64
64
|
|
|
65
65
|
case 'BYWEEKNO':
|
|
66
66
|
// RFC 5545: valid range is 1-53 or -53 to -1 (no zero)
|
|
67
|
-
rule.byWeekNo = this.parseIntList(value).filter(
|
|
68
|
-
v => v !== 0 && v >= -53 && v <= 53
|
|
69
|
-
);
|
|
67
|
+
rule.byWeekNo = this.parseIntList(value).filter(v => v !== 0 && v >= -53 && v <= 53);
|
|
70
68
|
break;
|
|
71
69
|
|
|
72
70
|
case 'BYMONTH':
|
package/core/ics/ICSHandler.js
CHANGED
|
@@ -228,7 +228,9 @@ export class ICSHandler {
|
|
|
228
228
|
|
|
229
229
|
// Only allow http and https schemes
|
|
230
230
|
if (parsed.protocol !== 'http:' && parsed.protocol !== 'https:') {
|
|
231
|
-
throw new Error(
|
|
231
|
+
throw new Error(
|
|
232
|
+
`URL scheme "${parsed.protocol}" is not allowed. Only http and https are permitted`
|
|
233
|
+
);
|
|
232
234
|
}
|
|
233
235
|
|
|
234
236
|
const hostname = parsed.hostname.toLowerCase();
|
package/core/ics/ICSParser.js
CHANGED
|
@@ -46,9 +46,7 @@ export class ICSParser {
|
|
|
46
46
|
}
|
|
47
47
|
// Enforce input size limit (uses instance config, falling back to static default)
|
|
48
48
|
if (icsString.length > this.maxFileSize) {
|
|
49
|
-
throw new Error(
|
|
50
|
-
`ICS input exceeds maximum size of ${this.maxFileSize / (1024 * 1024)}MB`
|
|
51
|
-
);
|
|
49
|
+
throw new Error(`ICS input exceeds maximum size of ${this.maxFileSize / (1024 * 1024)}MB`);
|
|
52
50
|
}
|
|
53
51
|
|
|
54
52
|
const events = [];
|