mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-24 03:11:13 -05:00
Refactor: Complete Photo System Refactor
This commit is contained in:
@@ -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;
|
||||
$$;
|
||||
Reference in New Issue
Block a user