Refactor: Complete Photo System Refactor

This commit is contained in:
gpt-engineer-app[bot]
2025-10-01 23:19:35 +00:00
parent 5e4773e54c
commit 1beb8ad2be
7 changed files with 259 additions and 154 deletions

View File

@@ -0,0 +1,14 @@
-- Fix security warning: Set search_path on extract_cf_image_id function
CREATE OR REPLACE FUNCTION extract_cf_image_id(url TEXT)
RETURNS TEXT
LANGUAGE plpgsql
IMMUTABLE
SECURITY DEFINER
SET search_path = public
AS $$
BEGIN
-- Extract ID from imagedelivery.net URL pattern
-- Pattern: https://imagedelivery.net/{account-hash}/{image-id}/{variant}
RETURN (regexp_match(url, '/([a-f0-9-]+)/[a-z0-9]+$'))[1];
END;
$$;