]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Add function to test character for domain safety
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 6 Feb 2019 14:17:59 +0000 (14:17 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 6 Feb 2019 14:17:59 +0000 (14:17 +0000)
src/libserver/url.c
src/libserver/url.h

index 4dcd11c9e6db25685ecd848e7434a85e5fb6daab..421c8a1812a453e745b6971ffa6f9b7f3bba6f68 100644 (file)
@@ -3323,3 +3323,9 @@ rspamd_url_encode (struct rspamd_url *url, gsize *pdlen,
 
        return (const gchar *)dest;
 }
+
+gboolean
+rspamd_url_is_domain (int c)
+{
+       return is_domain ((guchar)c);
+}
index 523fb2c1fb30e53a375bbadaafdd05ec699ff14a..4c34be9e7c88ca5f014388afab1eaa0e8e3cd54b 100644 (file)
@@ -232,4 +232,12 @@ gsize rspamd_url_decode (gchar *dst, const gchar *src, gsize size);
 const gchar * rspamd_url_encode (struct rspamd_url *url, gsize *dlen,
                rspamd_mempool_t *pool);
 
+
+/**
+ * Returns if a character is domain character
+ * @param c
+ * @return
+ */
+gboolean rspamd_url_is_domain (int c);
+
 #endif