diff --git a/README.md b/README.md index 317d99a..108421c 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,13 @@ # Calendar plugin for wordpress site Status as of 2026-03-31 when codex credit ran out: -1. Removal of plugin did not work. Need to set all files owner to www-data. -2. Deletion of event in ui doesn't delete event in thunderbird -3. Cannot subscribe to an empty calendar in thunderbird -4. Click inside month cell doesn't add event. -5. Login pane hidden under website hero/banner image +1. Removal of plugin did not work. Need to set all files owner to www-data. - done +2. Deletion of event in ui doesn't delete event in thunderbird - done +3. Cannot subscribe to an empty calendar in thunderbird - ok +4. Click inside month cell doesn't add event. - cannot reproduce +5. Login pane hidden under website hero/banner image - done 6. Updating an events description via caldav creates weird sequences, e.g. -a space ends up as: text/html,%C2%A0": + a space ends up as: text/html,%C2%A0": +7. In a private window, Click on event from not-logged-in calendar page shows event as a dialog box, it should show it as a panel with a subset of the edit event panel - i.e. the title, category, location, start and end and description. - +8. diff --git a/code/calendar-plugin.php b/code/calendar-plugin.php index 8abffcf..b37b95d 100644 --- a/code/calendar-plugin.php +++ b/code/calendar-plugin.php @@ -3,7 +3,7 @@ * Plugin Name: Calendar Plugin * Plugin URI: https://chezstephens.org.uk * Description: Provides a single shared calendar for WordPress with public display, authenticated event editing, user approval workflow, ICS publishing, and CalDAV read/write sync. Supports recurring events, single-occurrence exceptions, admin setup and diagnostics pages, and shortcode rendering for full calendar and upcoming-events sidebar views. - * Version: 0.1.15 + * Version: 1.0.1 * Requires at least: 6.0 * Requires PHP: 8.1 * Author: Adrian Stephens (with AI assistance) diff --git a/code/src/Domain/IcsService.php b/code/src/Domain/IcsService.php index 7927cdf..8749c24 100644 --- a/code/src/Domain/IcsService.php +++ b/code/src/Domain/IcsService.php @@ -346,7 +346,7 @@ final class IcsService if (!$in) { continue; } - [$left, $value] = array_pad(explode(':', $line, 2), 2, ''); + [$left, $value] = $this->splitContentLine($line); if ($left === '') { continue; } @@ -364,6 +364,23 @@ final class IcsService return $in ? $props : null; } + private function splitContentLine(string $line): array + { + $inQuotes = false; + $len = strlen($line); + for ($i = 0; $i < $len; $i++) { + $ch = $line[$i]; + if ($ch === '"') { + $inQuotes = !$inQuotes; + continue; + } + if ($ch === ':' && !$inQuotes) { + return [substr($line, 0, $i), substr($line, $i + 1)]; + } + } + return [$line, '']; + } + private function parseIcsDateTime(string $value, bool $dateOnly): ?string { $value = trim($value); diff --git a/code/src/Plugin.php b/code/src/Plugin.php index b328951..cc66c90 100644 --- a/code/src/Plugin.php +++ b/code/src/Plugin.php @@ -180,10 +180,10 @@ final class Plugin

Events

- + -