]> ruin.nu Git - ndwebbie.git/blob - database/functions/escape_html.sql
Make use of the newish planet id from stats
[ndwebbie.git] / database / functions / escape_html.sql
1 CREATE OR REPLACE FUNCTION escape_html(_unescaped text) RETURNS text
2     AS $_$
3 DECLARE
4 BEGIN
5         _unescaped := replace(_unescaped, '&', '&');
6         _unescaped := replace(_unescaped, '"', '"');
7         _unescaped := replace(_unescaped, '<', '&lt;');
8         _unescaped := replace(_unescaped, '>', '&gt;');
9         RETURN _unescaped;
10 END;
11 $_$
12     LANGUAGE plpgsql IMMUTABLE;
13