Cronicle icon indicating copy to clipboard operation
Cronicle copied to clipboard

Using [] at start of event name can result in un-deletable / un-editable events

Open mbafford opened this issue 4 years ago • 3 comments

Steps to produce:

  • Create event with an event name like "[<1024 alphanumeric characters] test1"
  • Edit said event
  • Event has a very long eventID, and the edit buttons at the bottom are not present/rendered on the page.

Screenshot of the broken event: 2021_01_13_08_39_49

Related #367

mbafford avatar Jan 13 '21 13:01 mbafford

The JavaScript code: $P().delete_event('edit') Allows to delete as normal (including the popup to confirm)

mbafford avatar Jan 13 '21 13:01 mbafford

I think you don't see buttons because those are outside the screen, they should exist.

mikeTWC1984 avatar Jan 13 '21 14:01 mikeTWC1984

Good point. Confirmed they exist, but are not reachable through scrolling (clipped by containing elements). 2021_01_13_09_46_47

Obviously this isn't a major issue - just noticed it testing the [] syntax more generally. I did expect some validation/sanitization on the event ID. I did notice the characters have to be alphanumeric (or, more correctly \w) - which you confirmed in #367:

		if (event.title.match(/^\[(\w+)\]\s*(.+)$/)) {
			event.id = RegExp.$1;
			event.title = RegExp.$2;
		}

mbafford avatar Jan 13 '21 14:01 mbafford